// Sequence of err catch.

#include <iostream>
#include <cstdio>
using namespace std;

class A { };
class B : public A { };

// designer
// ------------------------------------------------------------------
// user

void foo( ) {
	throw A( );
}

int main( void ) {
	try {
		foo( );
	}
	catch( B& e ) {
		cout << "B has been catched" << endl;
	}
	catch( A& e ) {
		cout << "A has been catched" << endl;
	}

	return 0;
}

